WebView

A custom android.webkit.WebView implementation that provides additional functionality for displaying web content within the RevelDigital player application.

This class extends the standard android.webkit.WebView and integrates with application-specific components like com.reveldigital.player.api.RevelControl and com.reveldigital.player.api.OnCommandListener. It handles custom configurations based on com.reveldigital.player.api.Module options, manages JavaScript execution, and provides hooks for navigation and callback events.

Key features include:

  • Configuration of WebView settings (e.g., JavaScript, plugins, user agent, cache mode).
  • Handling of basic HTTP authentication.
  • Support for custom asset loading via androidx.webkit.WebViewAssetLoader.
  • Integration with com.reveldigital.player.connectivity.ConnectivityMonitor to adjust cache settings based on network status.
  • Providing a com.reveldigital.player.JavascriptInterfaceObject for communication between JavaScript and native Android code.
  • Management of navigation and callback listeners (com.reveldigital.player.api.OnNavigateListener, com.reveldigital.player.api.OnCallbackListener).
  • Support for content refresh intervals.
  • Functionality to print the current web page content (requires API level 19+).

This WebView is typically initialized with a com.reveldigital.player.api.Module object, which dictates its behavior and content (URL, HTML, refresh intervals, etc.).

See also

Constructors

Link copied to clipboard
constructor(context: Context, module: Module)
Constructs a new WebView with a Context object and a Module object.

Properties

Link copied to clipboard
@Inject
open var connectivityMonitor: ConnectivityMonitor

Functions

Link copied to clipboard
Adds the OnCallbackListener.
Link copied to clipboard
Adds an OnNavigateListener to the WebView.
Link copied to clipboard
open fun dispose()
Called when the WebView is no longer needed and should release its resources.
Link copied to clipboard
open fun executeJavascript(script: String)
open fun executeJavascript(script: String, callback: ValueCallback<String>)
Execute the supplied Javascript within the loaded web page.
Link copied to clipboard
open fun getName(): String
Gets the unique name assigned to this control.
Link copied to clipboard
open fun getOptions(): Iterator<out Option>
Gets an iterator over the configuration s for this control.
Link copied to clipboard
open fun getPlaylist(): Playlist
Gets the associated with this control, if any.
Link copied to clipboard
open fun getType(): ModuleType
Gets the type of the underlying module or content associated with this control.
Link copied to clipboard
open fun getZIndex(): Int
Gets the Z-index (stacking order) of this control.
Link copied to clipboard
open fun initialize(module: Module)
Initializes the control with its associated module context.
Link copied to clipboard
open fun isAutoStart(): Boolean
Checks if this control is configured to start its operation automatically after #initialize(Module) initialization.
Link copied to clipboard
open fun isStarted(): Boolean
Checks if the control is currently in a started or active operational state.
Link copied to clipboard
open fun onCommand(name: String, value: String)
Invoked when a command is received by a component this listener is registered with.
Link copied to clipboard
Prints the currently displayed web page content.
Link copied to clipboard
Removes the specified OnCallbackListener from the list of listeners.
Link copied to clipboard
Removes the OnNavigateListener.
Link copied to clipboard
open fun setAutoStart(flag: Boolean)
Sets whether this control should start its operation automatically after #initialize(Module) initialization.
Link copied to clipboard
open fun start()
Starts or resumes the active operation of this control.
Link copied to clipboard
open fun stop()
Stops or pauses the active operation of this control.